load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "linear_combination",
    hdrs = ["linear_combination.h"],
    deps = [
        ":linear_combination_term",
        "//tachyon/base:parallelize",
        "//tachyon/base:random",
        "//tachyon/base/containers:container_util",
        "@com_google_absl//absl/container:flat_hash_map",
    ],
)

tachyon_cc_library(
    name = "linear_combination_term",
    hdrs = ["linear_combination_term.h"],
    deps = [
        "//tachyon/base:parallelize",
        "//tachyon/base/buffer:copyable",
    ],
)

tachyon_cc_library(
    name = "multilinear_extension",
    hdrs = [
        "multilinear_dense_evaluations.h",
        "multilinear_extension.h",
        "multilinear_extension_ops.h",
        "support_poly_operators.h",
    ],
    deps = [
        "//tachyon/base:bits",
        "//tachyon/base:logging",
        "//tachyon/base:openmp_util",
        "//tachyon/base:parallelize",
        "//tachyon/base/buffer:copyable",
        "//tachyon/base/containers:container_util",
        "//tachyon/base/strings:string_util",
        "//tachyon/math/base:parallelize_threshold",
        "//tachyon/math/polynomials:polynomial",
    ],
)

tachyon_cc_library(
    name = "multivariate_polynomial",
    hdrs = [
        "multivariate_polynomial.h",
        "multivariate_polynomial_ops.h",
        "multivariate_sparse_coefficients.h",
        "support_poly_operators.h",
    ],
    deps = [
        "//tachyon/base:logging",
        "//tachyon/base:parallelize",
        "//tachyon/base/containers:adapters",
        "//tachyon/base/containers:container_util",
        "//tachyon/base/containers:cxx20_erase",
        "//tachyon/base/ranges:algorithm",
        "//tachyon/base/strings:string_util",
        "//tachyon/math/polynomials:polynomial",
        "@com_google_absl//absl/hash",
        "@com_google_absl//absl/numeric:bits",
        "@com_google_absl//absl/types:span",
    ],
)

tachyon_cc_unittest(
    name = "multivariate_unittests",
    srcs = [
        "linear_combination_unittest.cc",
        "multilinear_dense_evaluations_unittest.cc",
        "multivariate_polynomial_unittest.cc",
    ],
    deps = [
        ":linear_combination",
        ":multilinear_extension",
        ":multivariate_polynomial",
        "//tachyon/math/finite_fields/test:finite_field_test",
        "//tachyon/math/finite_fields/test:gf7",
        "@com_google_absl//absl/hash:hash_testing",
    ],
)
